import os, time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

#远程调试
chrome_options = Options()
chrome_options.add_experimental_option("debuggerAddress", "127.0.0.1:9222")

driver = webdriver.Chrome(options=chrome_options)
file_path = os.path.join('file:///', os.getcwd(), "selenium.html")


# 打开html文件
driver.get(file_path)
upload = driver.find_element_by_css_selector('div#signup input[name="upload"]')

upload.send_keys('C:/Users/Administrator/Desktop/表单.xls')  # send_keys
time.sleep(5)
print (upload.get_attribute('value'))  # check value
driver.find_element_by_css_selector('#signup > form > input[type=submit]:nth-child(3)').click()

